package com.lz.sports.vm.config

import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import com.lz.library.base.BaseModel
import com.lz.library.base.BaseViewModel
import com.lz.sports.core.ProjectManager

class ConfigViewModel : BaseViewModel<BaseModel>() {

    val currentProjectName = MutableLiveData<String>()

    override fun onCreate(owner: LifecycleOwner) {
        super.onCreate(owner)
        currentProjectName.value = ProjectManager.currentExamProject?.projectName
    }

    fun selectProject(position: Int) {
        if (ProjectManager.selectProject(position)) {
            currentProjectName.value = ProjectManager.currentExamProject?.projectName
        }
    }
}